package Map;

public class Map {
	char[][] arr;

	public void create(int n, int m) {
		if (n > 0 & m > 0) {
			arr = new char[n][m];
			for (int i = 0; i < n; i++) {
				for (int j = 0; j < m; j++) {
					arr[i][j] = '.';
				}
			}
		} else
			System.out.println("Enter positive values!");
	}

	public void print() {
		//if (arr!=null && arr[0]!=null)
		if (arr.length > 0 & arr[0].length > 0) {
			for (int i = 0; i < arr.length; i++) {
				for (int j = 0; j < arr[0].length; j++) {
					System.out.print(arr[i][j] + " ");
				}
				System.out.println();
			}
		} else
			System.out.println("Create a matrix!");
	}

	public void mark(int x, int y) {
		if (x < arr.length & y < arr[0].length)
			if (x > 0 & y > 0)
				arr[x - 1][y - 1] = '*';
	}

}
